﻿@using X.PagedList;
@using X.PagedList.Mvc.Core;
@using X.PagedList.Mvc.Common;
@using FwProject.TypeNumber.Dto;
@model IPagedList<TypeNumberInfoDto>

@{
    Layout = null;
}
<div class="modal-dialog">
    <div class="modal-content animated fadeIn">
        <form class="form-horizontal" role="form">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
                <h4 class="modal-title">添加货品型号</h4>
            </div>
            <div class="modal-body">
                <div class="form-body">
                    <div>

                        <table class="table table-bordered table-hover table-rowselected">
                            <thead>
                                <tr>
                                    <th style="width:60px"><input type="checkbox" id="allchecked">全选</th>
                                    <th>型号名称</th>
                                    <th>描述</th>
                                    <th>数量</th>
                                    <th>单位</th>
                                    <th>默认装车型号</th>
                                </tr>
                            </thead>
                            <tbody>
                                @if (Model.Count == 0)
                                {
                                    <tr><td class="text-center" colspan="7">暂无餐厅型号信息</td></tr>
                                }
                                else
                                {
                                    foreach (var item in Model)
                                    {
                                        <tr>
                                            <td><input type="checkbox" value="@item.Id" name="typeNumberIds" data-id="@item.Id" data-count="@item.Count" data-name="@item.Name"></td>
                                            <td>@item.Name</td>
                                            <td>@item.Readme</td>
                                            <td>@item.Count</td>
                                            <td>@item.Unit</td>
                                            <td>@(item.IsActive ? "是" : "否")</td>
                                        </tr>
                                    }
                                }
                            </tbody>
                        </table>

                    </div>
                    <div class="row pagedinfo">
                        <div class="col-sm-5">
                            共 @Model.TotalItemCount 条，@Model.PageSize 条/页 当前第 @Model.PageNumber/@Model.PageCount 页
                        </div>
                        <div class="col-sm-7">
                            @Html.PagedListPager(Model, page => Url.Action("MoreTypeNumber", "TypeNumber", new { pageIdx = page }), PagedListRenderOptions.EnableUnobtrusiveAjaxReplacing(new AjaxOptions() { AllowCache = false, HttpMethod = "Get", UpdateTargetId = "data_list", OnSuccess = "AjaxSuccessCallback", OnBegin = "AjaxBegin" }))
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="reset" class="btn btn-default" data-dismiss="modal">取消</button>
                <button type="button" id="enterTypeNumber" class="btn btn-primary" data-loading-text="执行中...">确认</button>
            </div>
        </form>
    </div>
    <!-- /.modal-content -->
</div>




